//
//  GOViewcomg.m
//  WeddingCar
//
//  Created by Xiaoshiheng_pro on 2017/3/2.
//  Copyright © 2017年 Svip. All rights reserved.
//

#import "GOViewController.h"

@implementation GOViewController


+ (void)GoPushHidesBottomBarStoryboardViewControllerStoryboardname:(NSString *)storyboardname Identifier:(NSString *)Identifier WithController:(id)WithController finishBlock:(void(^)(id govc))finishBlock{

    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:storyboardname bundle:nil];
    UIViewController * GOVC = [storyboard instantiateViewControllerWithIdentifier:Identifier];
    GOVC.hidesBottomBarWhenPushed = YES;
    
    if (finishBlock) {
        finishBlock(GOVC);
    }
    
    
    UIViewController *VC = WithController;
    [VC.navigationController pushViewController:GOVC animated:YES];
    

}
+ (void)GoISLOGINPushHidesBottomBarStoryboardViewControllerStoryboardname:(NSString *)storyboardname Identifier:(NSString *)Identifier WithController:(id)WithController finishBlock:(void(^)(id govc))finishBlock{

    
    if (!ISLOGIN) {
        
        UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
        UINavigationController *object =  [storyboard instantiateViewControllerWithIdentifier:@"NavLogin"];
        
        [WithController presentViewController:object animated:YES completion:nil];
        
    }else{
        
        [self GoPushHidesBottomBarStoryboardViewControllerStoryboardname:storyboardname Identifier:Identifier WithController:WithController finishBlock:finishBlock];
        
        
    }
    
    

}





+ (void)GoPushHidesBottomBarViewControllerClassName:(NSString *)className WithController:(id)WithController finishBlock:(void(^)(id govc))finishBlock{
    
    
    UIViewController * GOVC = [[NSClassFromString(className) alloc]init];
    GOVC.hidesBottomBarWhenPushed = YES;
    if (finishBlock) {
        finishBlock(GOVC);
    }
    
    UIViewController *VC = WithController;
    
    [VC.navigationController pushViewController:GOVC animated:YES];
    
}

+ (void)GoISLOGINPushHidesBottomBarViewControllerClassName:(NSString *)className WithController:(id)WithController finishBlock:(void(^)(id govc))finishBlock{
    
    if (!ISLOGIN) {
        
        UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
        UINavigationController *object =  [storyboard instantiateViewControllerWithIdentifier:@"NavLogin"];
        
        [WithController presentViewController:object animated:YES completion:nil];
        
    }else{
        
        [self GoPushHidesBottomBarViewControllerClassName:className WithController:WithController finishBlock:finishBlock];
        
        
    }
}


@end
